import logging, os, pytest, requests, json


# 封装登录方法返回token
@pytest.fixture(scope='session')
def login():
    url = os.getenv('log_url')
    bady = {
        'username': "15533006888",
        'password': "123456"
    }
    rest = requests.post(url=url, json=bady)
    print("\n*************完成登录*************")
    return rest.json()['data']['token']
